package com.platform.security.constants;

import com.platform.security.enums.App;

/**
 * @author guoyunfei on 2021/11/23 16:44
 * @className AppValue
 * @description TODO
 * @Version 1.0
 */
public class AppValue {


    /**
     * 获取系统枚举值
     *
     * @return
     */
    public static App getAppValue(App app) {
        if (app.value().intValue() == 1) {
            return App.MINI;
        } else if (app.value().intValue() == 2) {
            return App.MP;
        } else if (app.value().intValue() == 3) {
            return App.H5;
        } else if (app.value().intValue() == 4) {
            return App.BYTE;
        } else if (app.value().intValue() == 5) {
            return App.KUAISHOU;
        }
        return null;
    }

    /**
     * 获取系统枚举值
     *
     * @return
     */
    public static App getAppValue(int appVal) {
        if (appVal == 1) {
            return App.MINI;
        } else if (appVal == 2) {
            return App.MP;
        } else if (appVal ==3) {
            return App.H5;
        } else if (appVal == 4) {
            return App.BYTE;
        } else if (appVal == 5) {
            return App.KUAISHOU;
        }
        return null;
    }

}
